using AutoMapper;
using Pay.DTO;
using Pay.Data;
using Pay.IService;

namespace Pay.Service.AutoMapper
{
    public class InviteHorsePowerSettingMapper : IStartupDto
    {
        private IMapperConfigurationExpression _cfg;
        public InviteHorsePowerSettingMapper(IMapperConfigurationExpression cfg)
        {
            _cfg = cfg;
        }
        public void Execute()
        {
            Create();
        }
        protected virtual void Create()
        {
            _cfg.CreateMap<InviteHorsePowerSetting, invite_horse_power_setting_dto>()
                .ForMember(dest => dest.id, src => src.MapFrom(c => c.Id))
                .ForMember(dest => dest.begin_time, src => src.MapFrom(c => c.BeginTime))
                .ForMember(dest => dest.end_time, src => src.MapFrom(c => c.EndTime))
                .ForMember(dest => dest.horse_power, src => src.MapFrom(c => c.HorsePower))
                .ForMember(dest => dest.status, src => src.MapFrom(c => c.Status))
                .ForMember(dest => dest.create_time, src => src.MapFrom(c => c.CreateTime))
                .ForMember(dest => dest.update_time, src => src.MapFrom(c => c.UpdateTime));

            _cfg.CreateMap<invite_horse_power_setting_dto, InviteHorsePowerSetting>()
                .ForMember(dest => dest.Id, src => src.MapFrom(c => c.id))
                .ForMember(dest => dest.BeginTime, src => src.MapFrom(c => c.begin_time))
                .ForMember(dest => dest.EndTime, src => src.MapFrom(c => c.end_time))
                .ForMember(dest => dest.HorsePower, src => src.MapFrom(c => c.horse_power))
                .ForMember(dest => dest.Status, src => src.MapFrom(c => c.status))
                .ForMember(dest => dest.CreateTime, src => src.MapFrom(c => c.create_time))
                .ForMember(dest => dest.UpdateTime, src => src.MapFrom(c => c.update_time));

        }
    }
}
